package com.example.demo.gather;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("22"); //warn
        //List test = (ArrayList) list.subList(0, 1);//ClassCastException

        List originList = new ArrayList();
        originList.add("22");
        List subList = originList.subList(0, 1); //warn originList.add("22"); subList.get(0); // 抛出 java.util.ConcurrentModificationException
    }
}
